package com.dong.jdk8.function;

import java.util.function.Function;

/**
 * Created by jianyang206881 on 2017/9/26.
 */
public class FunctionDemo {
    //API which accepts an implementation of
    //Function interface
    public static void modifyTheValue(int valueToBeOperated, Function<Integer, Integer> function) {

        int newValue = function.apply(valueToBeOperated);
        /*
        * Do some operations using the new value.
        */
        System.out.println(newValue);
    }

}
